@extends('layouts.admin.head')
@section('title')
    管理菜单
@endsection
@section('headStyle')
    <!-- DataTables -->
    <link rel="stylesheet" href="{{asset('plugins/datatables/dataTables.bootstrap.css')}}">
@endsection
@section('content')
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            管理菜单
            <small>全部  菜单</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i>管理平台</a></li>
            <li><a href="#">管理菜单</a></li>
            <li class="active">菜单中心</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        {{--<h3 class="box-title">列表数据</h3>--}}
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table id="data" class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>菜单名称</th>
                                <th>菜单路由</th>
                                <th>是否隐藏</th>
                                <th>图标样式</th>
                                <th>上级菜单</th>
                                <th>创建时间</th>
                            </tr>
                            </thead>
                            <tbody>
                                @foreach($menus as $item)
                                    <tr>
                                        <td>{{$item->id}}</td>
                                        <td>{{$item->name}}</td>
                                        <td>{{$item->route}}</td>
                                        <td>{{$item->isActive=='1'?'显示':'隐藏'}}</td>
                                        <td>{{$item->icon}}</td>
                                        <td>{{$item->parent_id}}</td>
                                        <td>{{$item->created_at}}</td>
                                    </tr>
                                @endforeach
                            </thead>
                            <tbody>
                            </tfoot>
                        </table>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
@endsection
@section('pageInlineScript')
    <script src="{{asset('plugins/datatables/jquery.dataTables.min.js')}}"></script>
    <script src="{{asset('plugins/datatables/dataTables.bootstrap.min.js')}}"></script>
    <script>
        $(function () {
            var tables =  $('#data').dataTable({
                "processing": true,
                "autoWidth":false,
                "aLengthMenu": [15, 30, 50, 100 ],
                "oLanguage": {
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    },
                    "sSearch":'检索：',
                    "sZeroRecords": "没有检索到数据",
                    "sProcessing": "<img src='images/loading.gif' />"
                }
            } );
        })

    </script>
@endsection